import { get, post, put, del } from "@/utils/request";
import { get_perm } from "../tool";

/*
 公海
*/

// 获取公海列表 //分总,区总
export function busineslist(params) {
  return post(`${get_perm("busineslist")}?pageNum=${params.pageNum}`, params);
}
// 公海绑定到临时库
export function bindTemp(params) {
  return post(`/business/public/bind/temp?id=${params}`);
}

// 公海绑定到私海
// export function highSeaMovePrivate(params) {
//   return post(`/business/public/bind/private?id=${params}`);
// }

// 商机信息
export function businesInfo(params) {
  return get("/business/opportunity/info", params);
}

// 商机跟进信息
export function follow(params) {
  return get("/business/opportunity/follow", params);
}
// 店铺信息
export function storeShop(params) {
  return get("/business/opportunity/store", params);
}
// 合同信息(数据来源未定，字段后期会有改动)
export function contract(params) {
  return get("/business/opportunity/contract", params);
}
// kp信息
export function contractKp(params) {
  return get("/business/opportunity/kp", params);
}

/*
沉寂库
*/

// 沉寂库列表
export function silenceSea(params) {
  return post(`${get_perm("silenceSea")}?pageNum=${params.pageNum}`, params);
}
// 沉寂库移入公海
export function silenceMove(params) {
  return post(`/business/silent/move/public?id=${params}`);
}

/*
临时库
*/

// 临时库列表
export function tempSea(params) {
  return post(`${get_perm("tempSea")}?pageNum=${params.pageNum}`, params);
}
// 临时库移入公海
export function tempMove(params) {
  return post(`/business/temp/move/public?id=${params}`);
}
// // 临时库移入私海
// export function tempMoveprivate(params) {
//   return post(`/business/temp/move/private?id=${params}`);
// }

/*
私海
*/

// 私海列表
export function private_sea(params) {
  return post(`${get_perm("private_sea")}?pageNum=${params.pageNum}`, params);
}
// 私海下放至临时库                  //*********这里要改成解绑到公海 */
export function tempMoveTemp(params) {
  return post(`/business/private/move/temp?id=${params}`);
}

/*
外区商机
*/

// 外区商机列表
export function out_business(params) {
  return post(`${get_perm("out_business")}?pageNum=${params.pageNum}`, params);
}

/*
  详情按钮
*/
//字典
export function businessDataStatus(params) {
  return get("/dict/type", params);
}
// 商机状态变更
export function changeStatus(params) {
  return post("/business/opportunity/status/change", params);
}
//编辑KP
export function editKP(params) {
  return put("/kp/edit", params);
}
//新增KP
export function addKP(params) {
  return post("/kp/add", params);
}
//变更BD列表
export function commonLocationBD(params) {
  return get("/common/location/bd", params);
}
//跟进kp列表
export function kpList(params) {
  return get("/kp/list/boId", params);
}
// 商机基本信息编辑
export function editBaseInfo(params) {
  return put("/business/base/info/edit", params);
}
// 外呼或微信跟进新增
export function followAdd(params) {
  return post("/follow/up/add/online", params);
}
// 编辑店铺
export function storeEdit(params) {
  return post("/store/edit", params);
}
// 新增店铺
export function storeAdd(params) {
  return post("/store/add", params);
}
// 删除店铺
export function storeDel(params) {
  return del("/store/remove", params);
}

// 店铺校验编辑或删除次数
export function storeCheck(params) {
  return post("/store/check/times", params);
}
// kp校验编辑次数
export function kpCheck(params) {
  return post("/kp/check/times", params);
}

//转移店铺可选商机列表
export function storeBusinessOpportunity(params) {
  return post("/business/search/list", params);
}

//确定转移店铺
export function storeTransfer(params) {
  return post("/store/move", params);
}

// 我即将掉落的商机数量
export function falling_num() {
  return get("/business/falling/num");
}
// 我即将掉落的商机列表
export function falling() {
  return get("/business/falling");
}
// 变更bd
export function businessChangeBd(params) {
  return post("/business/opportunity/change/bd", params);
}
//检查poi是否重复接口
export function poiIsRepeatCheck(params) {
  return get("/store/check/poiIsRepeat", params);
}
//店铺详情
export function storeDetail(params) {
  return get("/store/detail", params);
}

// 查询商机是否签约
export function businessis_sign(params) {
  return get("/business/is_sign", params);
}
